/* Common styles */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    font-family: "Times New Roman", serif;
}

body,
.btn-main,
.btn-additional,
.body-link,
.content-link,
.button-select__option,
.modal-block__header-capt,
.modal-block__option-check,
.modal-block__option-label,
.btn-modal,
.btn-option,
.footer__link,
#option-mode,
#option-mirror {
    cursor: url("../images/h-cursor.png"), auto;
}

body {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border: 3px transparent solid;
    border-image: url("../images/body_border.png") 3 round;
    background: url("../images/body_background.png") #292929;
}

.hidden {
    display: none;
    visibility: hidden;
}

/* Animated modal styles */
#overlay {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    background-color: transparent;
    position: fixed;
    overflow: hidden scroll;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

#overlay::-webkit-scrollbar {
    display: none;
}

.scroll__hidden {
    overflow: hidden;
}

.to-mono_chrome {
    animation-name: toggleToGray;
    animation-duration: 0.75s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards;
}

.to-normal_color {
    animation-name: toggleToNormal;
    animation-duration: 0.75s;
    animation-timing-function: ease-in-out;
    animation-fill-mode: forwards;
}

.to-visible {
    animation-name: toggleToVisible;
    animation-duration: 0.75s;
    animation-timing-function: ease-in;
    animation-fill-mode: forwards;
}

.to-transparent {
    animation-name: toggleToTransparent;
    animation-duration: 0.75s;
    animation-timing-function: ease-out;
    animation-fill-mode: forwards;
}

@keyframes toggleToGray {
    0% {
        filter: grayscale(0);
        -webkit-filter: grayscale(0);
    }

    100% {
        filter: grayscale(100%);
        -webkit-filter: grayscale(100%);
    }
}

@keyframes toggleToNormal {
    0% {
        filter: grayscale(100%);
        -webkit-filter: grayscale(100%);
    }

    100% {
        filter: grayscale(0);
        -webkit-filter: grayscale(0);
    }
}

@keyframes toggleToTransparent {
    0% {
        opacity: 100%;
    }

    100% {
        opacity: 0;
    }
}

@keyframes toggleToVisible {
    0% {
        opacity: 0;
    }

    100% {
        opacity: 100%;
    }
}

/* Content containers styles */
html {
    height: 100%;
}

.popup__wrap {
    position: absolute;
    z-index: 1200;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.content,
.modal__border {
    margin: -23px;
}

.content__body-row {
    display: flex;
    justify-content: space-between;
    margin: 1.5% 0;
}

.content__body-col {
    margin: 1.5% 0;
}

.content__header,
#modal_header {
    text-align: center;
    padding: 1%;
    background: rgba(0, 0, 0, .3);
    border: 2px solid #6b739c;
    border-radius: 2px;
}

.modal-block__control {
    display: inline-block;
    background: rgba(0, 0, 0, .3);
    border: 2px solid #6b739c;
    border-radius: 2px;
    padding: 0.1em;
    margin-bottom: 1.5%;
}

.modal-block__options {
    display: inline-block;
    padding: 0.25em;
    margin-bottom: 1.5%;
}

#option-mode_name {
    padding: 0;
    width: 100%
}

#inp-mode_name {
    font-size: 0.9em;
    padding: 0.5em;
    color: #efd77b;
    background: transparent;
    border: none;
    width: 100%;
}

.content__footer,
.grid__in-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

.content__border,
#modal_wrap {
    border: 41px solid transparent;
    border-image: url("../images/border_sprite.png") 41 round;
    background: url("../images/background.png") #21316b;
}

.grid__border {
    margin: 0.5em;
}

#popup-container,
.grid__border,
.side__border {
    border: 44px solid transparent;
    border-image: url("../images/modal-border-sprite.png") 44 round;
    background: url("../images/modal_background.png") #392918;
}

.popup__border,
.side__body,
.grid__content {
    margin: -29px;
}

.grid__content {
    padding: 0.4em;
}

.popup__border {
    font-size: 1.2em;
    padding: 35px;
}

.side__header,
.content__misc,
.modal-block__header {
    background: rgba(0, 0, 0, .3);
    border: 2px solid #6b739c;
    border-radius: 2px;
    padding: 2.5%;
    margin-bottom: 2.5%;
}

#modal_header {
    margin-bottom: 1.5%;
    padding: 1.5%;
}

.modal-block__header {
    margin-bottom: 0.5%;
    padding: 1.5%;
}

.separator {
    background: #efd77b;
    box-shadow: 2px 2px #000;
}

.hero,
.skills,
.speciality {
    margin: 0.5em;
}

.skill {
    width: 50%;
}

.header__text,
.hero,
.skills,
.skill,
.speciality {
    display: flex;
    flex-direction: row;
}

#option-mode,
#option-mirror {
    background: transparent;
    border: 1px solid #6b739c;
    border-radius: 1px;
    font-size: 1em;
    min-width: 25em;
    color: #efd77b;
}

#option-mode option,
#option-mirror option {
    background: #21316b;
    border-left: 1px solid #6b739c;
    border-right: 1px solid #6b739c;
}

#option-mode option:last-child,
#option-mirror option:last-child {
    border-bottom: 1px solid #6b739c;
    border-bottom-left-radius: 1px;
    border-bottom-right-radius: 1px;
}

#option-mode option:first-child ,
#option-mirror option:first-child {
    border-top: 1px solid #6b739c;
    border-top-left-radius: 1px;
    border-top-right-radius: 1px;
}

#grid-towns,
.grid__hero-block:not(.hidden) {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    margin-bottom: 1.5%;
}

.grid__town-tile,
.grid__hero-tile {
    width: 4em;
    border: 1px solid #000;
    margin: 0.1em;
    line-height: 0;
}

.grid__town-tile.skipped:after,
.grid__hero-tile.skipped:after {
    display: block;
    margin-top: -1.2em;
    height: 1em;
    text-align: right;
    z-index: 1100;
    content: url("../images/banned-icon.png");
    transform: scale(1.5);
    margin-left: 30%;
    width: 50%;
}

.grid__town-tile.used:after,
.grid__hero-tile.used:after {
    display: block;
    margin-top: -1.2em;
    height: 1em;
    text-align: right;
    z-index: 1100;
    content: url("../images/used-icon.png");
    transform: scale(1.5);
    margin-left: 30%;
    width: 50%;
}

.grid__town-tile.banned,
.grid__hero-tile.banned {
    opacity: 0.25;
}

.body-links {
    position: absolute;
    bottom: 0.5em;
    left: 0.5em;
}

.content__misc-options {
    margin-top: 0.5em;
}

.modal-block__option-check {
    display: block;
    margin-left: 0.25em;
}

.modal-block__option-label {
    display: block;
    margin-left: 2.5rem;
}

.modal-block__option {
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 2.5rem;
}

/* Images styles */
.side__town,
.side__hero,
.side__spec,
.side__skill,
.content-link,
.grid__town-tile img,
.grid__hero-tile img {
    width: 100%;
}

.hero__img {
    width: 3.75em;
    height: 4.15em;
    line-height: 0;
    display: flex;
    align-items: center;
}

.spec__img {
    width: 2.5em;
    height: 2.5em;
    line-height: 0;
    display: flex;
    align-items: center;
}

.skill__img {
    width: 2.5em;
    height: 2.8em;
    line-height: 0;
    display: flex;
    align-items: center;
}

.header__town-img {
    width: 15%;
    line-height: 0;
}

/* Buttons styles */
.button__block {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

#modal_footer {
    text-align: center;
}

.btn-main {
    background: url("../images/button-sprite.png");
    background-size: 100% 100%;
    width: 49%;
    font-size: 1.3em;
    padding: 0.4em 5%;
    line-height: 1.5em;
    border: none;
    text-transform: uppercase;
    font-weight: bold;
    margin: 0 0.25%;
    letter-spacing: -0.01em;
}

.footer__link,
.footer__link:visited {
    text-align: center;
    display: inline-block;
    text-decoration: none;
    color: #000;
}

.btn-additional,
.footer__link,
.footer__link:visited {
    background: url("../images/link-button.png");
    background-size: 100% 100%;
    width: 49%;
    font-size: 1.3em;
    padding: 0.4em;
    line-height: 1.5em;
    border: none;
    text-transform: uppercase;
    font-weight: bold;
    margin: 0 0.25%;
    letter-spacing: -0.01em;
}

.btn-main:active {
    background: url("../images/button-p-sprite.png");
    background-size: 100% 100%;
}

.btn-additional:active,
.footer__link:active {
    background: url("../images/link-button-p.png");
    background-size: 100% 100%;
}

.button-select__option {
    border: 3px transparent solid;
    border-image: url("../images/option-border.png") 2 round;
    background: rgba(0, 0, 0, .3);
    text-transform: uppercase;
    font-size: 1.5em;
    padding: 0.05em 0.5em;
    font-weight: bold;
}

.btn-option {
    border: 3px transparent solid;
    border-image: url("../images/option-border.png") 2 round;
    background: rgba(0, 0, 0, .3);
    font-size: 1.1em;
    padding: 0.05em 0.5em;
}

.button-select__option.selected {
    border-image: url("../images/option-border-a.png") 3 round
}

.btn-modal {
    border: none;
}

.button-close {
    background: url("../images/button-no.png") #2a1b18 no-repeat;
    background-size: 100% 100%;
}

.button-confirm {
    background: url("../images/button-yes.png") #2a1b18 no-repeat;
    background-size: 100% 100%;
}

.button-close:active {
    background: url("../images/button-p-no.png") #2a1b18 no-repeat;
    background-size: 100% 100%;
}

.button-confirm:active {
    background: url("../images/button-p-yes.png") #2a1b18 no-repeat;
    background-size: 100% 100%;
}

.modal-block__option-check:before {
    width: 3rem;
    height: 2.25rem;
    margin-top: -0.625rem;
    display: block;
    box-sizing: border-box;
    border: 2px transparent solid;
    border-image: url("../images/option-border.png") 2 round;
    content: '';
    background: url("../images/checked-no.png");
    background-size: 100%;
}

.modal-block__option-check:checked:before {
    display: block;
    content: '';
    background: url("../images/checked-yes.png");
    background-size: 100%;
}

/* Text block styles */
.header__text-capt,
.spec__title,
.skill__level,
.hero__name,
.content__misc-header,
.modal-block__header-capt,
.body-link,
.body-link:visited,
.button-select__option,
.modal-block__option-label {
    color: #efd77b;
    text-shadow: 1px 1px #000;
}

.body-link,
.body-link:visited {
    font-size: 0.8em;
    text-decoration: underline;
}

.content-link,
.content-link:visited {
    display: inline-block;
    text-decoration: none;
}

.hero__name {
    line-height: 1.6em;
    font-size: 1.4em;
    font-weight: bold;
    text-align: center;
}

.hero__type {
    text-align: center;
}

.header__text-city,
.hero__type,
.spec__name,
.skill__name,
.modal-block__header-text,
.popup__message,
.content__header-text,
.btn-option {
    color: #fff;
    text-shadow: 1px 1px #000;
}

.modal-block__header-capt,
.modal-block__header-text {
    display: block;
}

.header__text-city {
    padding: 0 1em;
}

.header__text-capt {
    margin-bottom: 2.5%;
}

.hero__text,
.spec__img,
.spec__text,
.skill__img,
.skill__text {
    border: 2px solid #7b6653;
    border-radius: 2px;
    background-color: rgba(0, 0, 0, 0.25);
}

.skill__text {
    width: 9.25em;
}

.spec__text {
    width: 21.39em;
}

.hero__text {
    width: 20em;
    margin: 0 0.1em;
}

.skill__text,
.spec__text {
    padding: 0 0.5em;
}

.header__text {
    align-items: center;
}

#modal_header,
.content__header-capt {
    font-weight: bold;
    color: #efd77b;
    text-shadow: 2px 2px #000;
    font-size: 1.4em;
}

.popup__message {
    word-break: break-word;
    font-size: 1.2em;
}

.content__header-text {
    font-size: 1em;
}

/* Mirror fixes */
.side:last-child .side__header {
    text-align: right;
}

.side:first-child .skill__text,
.side:first-child .spec__text {
    border-left: none;
}

.side:last-child .skill__text,
.side:last-child .spec__text {
    border-right: none;
}

.side:last-child .header__text,
.side:last-child .hero,
.side:last-child .speciality,
.side:last-child .skill {
    justify-content: flex-end;
    text-align: right;
}

/* Cross-browser styles */
/*
  ## Device = Desktops
  ## Screen = 1281px to higher resolution desktops
*/
@media (min-width: 1281px) {
    #content_wrap {
        width: 1150px;
    }

    body {
        font-size: 20px;
    }

    #modal_wrap {
        width: 950px;
    }

    #popup-container {
        max-width: 600px;
    }

    .side {
        width: 48%;
    }

    .separator {
        width: 0.1em;
        margin-bottom: -3.75em;
    }

    .content__body-row {
        flex-direction: row;
    }

    .button__block {
        width: 48%;
    }

    .btn-modal {
        width: 8em;
        height: 4.69em;
    }
}

/*
  ##Device = Laptops, Desktops
  ##Screen = B/w 1025px to 1280px
*/
@media (min-width: 1025px) and (max-width: 1280px) {
    #content_wrap {
        width: 950px;
    }

    body {
        font-size: 18px;
    }

    #modal_wrap {
        width: 785px;
    }

    #popup-container {
        max-width: 500px;
    }

    .side {
        width: 48%;
    }

    .separator {
        width: 0.1em;
        margin-bottom: -3.75em;
    }

    .content__body-row {
        flex-direction: row;
    }

    .button__block {
        width: 48%;
    }

    .btn-modal {
        width: 8em;
        height: 4.69em;
    }
}

/*
  ##Device = Tablets, Ipads (portrait)
  ##Screen = B/w 768px to 1024px
*/
@media (min-width: 768px) and (max-width: 1024px) {
    #content_wrap {
        width: 700px;
    }

    body {
        font-size: 14px;
    }

    #modal_wrap {
        width: 580px;
    }

    #popup-container {
        max-width: 350px;
    }

    .side {
        width: 48%;
    }

    .separator {
        width: 0.1em;
        margin-bottom: -3.75em;
    }

    .content__body-row {
        flex-direction: row;
    }

    .button__block {
        width: 48%;
    }

    .btn-modal {
        width: 6em;
        height: 3.52em;
    }
}

/*
  ##Device = Tablets, Ipads (landscape)
  ##Screen = B/w 768px to 1024px
*/
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    #content_wrap {
        width: 700px;
    }

    body {
        font-size: 14px;
    }

    #modal_wrap {
        width: 580px;
    }

    #popup-container {
        max-width: 350px;
    }

    .side {
        width: 48%;
    }

    .separator {
        width: 0.1em;
        margin-bottom: -3.75em;
    }

    .content__body-row {
        flex-direction: row;
    }

    .button__block {
        width: 48%;
    }

    .btn-modal {
        width: 6em;
        height: 3.52em;
    }
}

/*
  ##Device = Low Resolution Tablets, Mobiles (Landscape)
  ##Screen = B/w 481px to 767px
*/
@media (min-width: 481px) and (max-width: 767px) {
    #content_wrap {
        width: 470px;
    }

    body {
        font-size: 12px;
    }

    #modal_wrap {
        width: 390px;
    }

    #popup-container {
        max-width: 300px;
    }

    .side {
        width: 70%;
    }

    .separator {
        width: 90%;
        height: 0.1em;
        margin: 0.5em 0;
    }

    .content__body-row {
        align-items: center;
        flex-direction: column;
    }

    .content__footer {
        width: 70%;
        align-items: center;
        flex-direction: column;
        margin: 0 auto;
    }

    .button__block {
        width: 96%;
        margin-bottom: 0.5em;
    }


    .btn-modal {
        width: 4em;
        height: 2.35em;
    }
}

/*
  ##Device = Most of the Smartphones Mobiles (Portrait)
  ##Screen = B/w 320px to 479px
*/
@media (min-width: 320px) and (max-width: 480px) {
    #content_wrap {
        width: 95%;
    }

    body {
        font-size: 10px;
    }

    #modal_wrap {
        width: 85%;
    }

    #popup-container {
        max-width: 70%;
    }

    .side {
        width: 97.5%;
    }

    .separator {
        width: 100%;
        height: 0.1em;
        margin: 0.25em 0;
    }

    .content__body-row {
        align-items: center;
        flex-direction: column;
    }

    .content__footer {
        width: 90%;
        flex-direction: column;
        align-items: center;
        margin: 0 auto;
    }

    .button__block {
        width: 96%;
        margin-bottom: 0.25em;
    }

    .btn-modal {
        width: 4em;
        height: 2.35em;
    }
}
